package com.hawk.domain;

/**
 * @author hawk
 * @date 2022/1/12 20:23
 * @desc 日志信息
 **/
public class LogDomain {
    /**
     * 操作者ip
     */
    private String ip;

    /**
     * 操作者
     */
    private String user;

    /**
     * 方法名
     */
    private String methodName;

    /**
     * 参数
     */
    private Object[] args;

    /**
     * 具体操作
     */
    private String operate;

    /**
     * 业务对象标识
     */
    private String resourceNo;

    /**
     * 操作日志类型(eg. 订单，用户)
     */
    private String category;

    /**
     * 备注
     */
    private String remark;

    public static LogDomain.LogDomainBuilder builder() {
        return new LogDomain.LogDomainBuilder();
    }

    public String getIp() {
        return this.ip;
    }

    public String getUser() {
        return this.user;
    }

    public String getMethodName() {
        return this.methodName;
    }

    public Object[] getArgs() {
        return this.args;
    }

    public String getOperate() {
        return this.operate;
    }

    public String getResourceNo() {
        return this.resourceNo;
    }

    public String getCategory() {
        return this.category;
    }

    public String getRemark() {
        return this.remark;
    }

    public void setIp(final String ip) {
        this.ip = ip;
    }

    public void setUser(final String user) {
        this.user = user;
    }

    public void setMethodName(final String methodName) {
        this.methodName = methodName;
    }

    public void setArgs(final Object[] args) {
        this.args = args;
    }

    public void setOperate(final String operate) {
        this.operate = operate;
    }

    public void setResourceNo(final String resourceNo) {
        this.resourceNo = resourceNo;
    }

    public void setCategory(final String category) {
        this.category = category;
    }

    public void setRemark(final String remark) {
        this.remark = remark;
    }

    public LogDomain(final String ip, final String user, final String methodName, final Object[] args, final String operate, final String resourceNo, final String category, final String remark) {
        this.ip = ip;
        this.user = user;
        this.methodName = methodName;
        this.args = args;
        this.operate = operate;
        this.resourceNo = resourceNo;
        this.category = category;
        this.remark = remark;
    }

    public LogDomain() {
    }

    public static class LogDomainBuilder {
        private String ip;
        private String user;
        private String methodName;
        private Object[] args;
        private String operate;
        private String resourceNo;
        private String category;
        private String remark;

        LogDomainBuilder() {
        }

        public LogDomain.LogDomainBuilder ip(final String ip) {
            this.ip = ip;
            return this;
        }

        public LogDomain.LogDomainBuilder user(final String user) {
            this.user = user;
            return this;
        }

        public LogDomain.LogDomainBuilder methodName(final String methodName) {
            this.methodName = methodName;
            return this;
        }

        public LogDomain.LogDomainBuilder args(final Object[] args) {
            this.args = args;
            return this;
        }

        public LogDomain.LogDomainBuilder operate(final String operate) {
            this.operate = operate;
            return this;
        }

        public LogDomain.LogDomainBuilder resourceNo(final String resourceNo) {
            this.resourceNo = resourceNo;
            return this;
        }

        public LogDomain.LogDomainBuilder category(final String category) {
            this.category = category;
            return this;
        }

        public LogDomain.LogDomainBuilder remark(final String remark) {
            this.remark = remark;
            return this;
        }

        public LogDomain build() {
            return new LogDomain(this.ip, this.user, this.methodName, this.args, this.operate, this.resourceNo, this.category, this.remark);
        }
    }

}
